from django.contrib.flatpages.models import *

### Snippet:
from django import forms

class UploadFileForm(forms.Form):
    title = forms.CharField(max_length=50)
    file  = forms.FileField()
####

class InteresesVisita(models.Model) :
    nombre = models.CharField(max_length=100)

    def __unicode__(self):
        return u""


class Formulario(models.Model) :
    ip = models.IPAddressField()
    fecha = models.DateTimeField()
    comentarios = models.CharField(max_length=2000, blank=True,null=True )

    def __unicode__(self):
        return u""


class FormularioSocial(Formulario) :
    nombrepersona = models.CharField(max_length=150)
    correopersona = models.EmailField()
    cargo = models.CharField(max_length=100)
    nombreinst = models.CharField(max_length=200)
    nombremaximo = models.CharField(max_length=150)
    telefonos = models.CharField(max_length=300)
    direccion = models.CharField(max_length=300)
    fax = models.CharField(max_length=200, null=True,blank=True )
    correoinst = models.CharField(max_length=200, null=True,blank=True )
    pagina = models.CharField(max_length=300, null=True,blank=True )

    def __unicode__(self):
        return u""


class Seccion(models.Model) :
    nombre = models.CharField(max_length=30)
    alt = models.CharField(max_length=100)
    pagina = models.ForeignKey(FlatPage,null=True)
    url = models.CharField(max_length=100, null=True )

    def __unicode__(self):
        return u""


class Caja(models.Model) :
    pos = models.IntegerField()
    nombre = models.CharField(max_length=30)
    alt = models.CharField(max_length=100, null=True )
    peso = models.FloatField(default=0)
    seccion = models.ForeignKey(Seccion)
    pagina = models.ForeignKey(FlatPage,null=True)
    url = models.CharField(max_length=100, null=True )

    def __unicode__(self):
        return u""


class Enlace(models.Model) :
    nombre = models.CharField(max_length=30)
    alt = models.CharField(max_length=100, null=True )
    peso = models.FloatField(default=0)
    caja = models.ForeignKey(Caja)
    pagina = models.ForeignKey(FlatPage,null=True)
    url = models.CharField(max_length=100, null=True )

    def __unicode__(self):
        return u""


class FormularioVisita(Formulario) :
    nombrepersona = models.CharField(max_length=150)
    correopersona = models.EmailField()
    cargo = models.CharField(max_length=100)
    nombreinst = models.CharField(max_length=200)
    nombremaximo = models.CharField(max_length=150)
    expercompu = models.CharField(max_length=300)
    direccion = models.CharField(max_length=300)
    telefonos = models.CharField(max_length=300)
    fax = models.CharField(max_length=200, null=True,blank=True )
    correoinst = models.CharField(max_length=200, null=True,blank=True )
    pagina = models.CharField(max_length=300, null=True,blank=True )
    intereses = models.ManyToManyField(InteresesVisita)

    def __unicode__(self):
        return u""


class FormularioAspirante(Formulario) :
    nombre = models.CharField(max_length=100)
    grado = models.IntegerField()
    telefonos = models.CharField(max_length=150)
    direccion = models.CharField(max_length=150)
    acudiente = models.CharField(max_length=200)
    email = models.EmailField(null=True,blank=True)

    def __unicode__(self):
        return u""

